Hack Name: Portal System Addon: Ten Richest Members v1.0

Author: GuldantheWarlock (GuldantheWarlock@xmbgarage.com)

Last Updated: 04/18/2009

Description:
This modification will add a block to your portal that will display the 10 richest members on your board.

Supported Version: XMB 1.9.8 SP3

Updated for 1.9.8 by: WormHole @XMB Garage

Notes:
This modification requires XMB Portal v2.4 and the Shop Hack v1.3 to be installed before installing.

This modification is released under the GPL. A copy is provided with this software package.

Please backup your files before installing this modification. Neither XMB Garage nor the author can be held responsible if your board stops functioning properly due to you installing this modification.

=======================================================================================================

=======
Step 1:
=======

===========================
Edit lang/Portal.lang.php:
===========================

=====
Find:
=====

?>

==========
Add Above:
==========

// Ten Richest Members Mod Begin
$lang['tenrichest'] = "10 Richest Members";
// Ten Richest Members Mod End

=======================================================================================================

=======
Step 2:
=======

================
Edit portal.php:
================

=====
Find:
=====

'portal_quick_reg'

============
Replace With:
============

'portal_quick_reg',
'portal_richest'

=====
Find:
=====

$sql = $db->query("SELECT p.*, t.* FROM ".X_PREFIX."portal_templates p LEFT JOIN ".X_PREFIX."templates t ON t.name=p.name WHERE p.status='on' ORDER BY p.displayorder ASC LIMIT 0, 30");

==========
Add Above:
==========

// Ten Richest Members Mod Begin
$richestmembers = array();
$richestquery = $db->query("SELECT username, money FROM ".X_PREFIX."members ORDER BY money DESC LIMIT 10");
while($richest = $db->fetch_array($richestquery)) {
    $richestmembers[] = "<tr>\n<td class=\"tablerow\" bgcolor=\"$THEME[altbg2]\"><a href=\"./member.php?action=viewpro&amp;username=".rawurlencode($richest[username])."\">$richest[username]</a></td><td class=\"tablerow\" bgcolor=\"$THEME[altbg1]\">$richest[money]</td>\n</tr>";
}
$richestmembers = implode("\n", $richestmembers);
// Ten Richest Members Mod End

=======================================================================================================

=======
Step 3:
=======

===========================================================
Go to Administration Panel -> Portal Admin -> Create Block: portal_richest
===========================================================

====================
Add Code and Submit:
====================

<table cellspacing="0" cellpadding="0" border="0" width="100%" bgcolor="$THEME[bordercolor]">
<tr>
<td>
<table border="0" cellspacing="$THEME[borderwidth]" cellpadding="$THEME[tablespace]" width="100%">
<tr>
<td class="category" colspan="2"><strong><font color="$THEME[cattext]">&raquo; $lang[tenrichest]</font></strong></td>
$richestmembers
</table>
</td>
</tr>
</table>

=======================================================================================================
Enjoy!